package com.example.administrator.xiaobo.holder;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bigkoo.convenientbanner.holder.Holder;
import com.bumptech.glide.Glide;
import com.example.administrator.xiaobo.R;
import com.example.administrator.xiaobo.bean.show_5_itemBean;

import static com.bumptech.glide.gifdecoder.GifHeaderParser.TAG;

/**
 * Created by Administrator on 2017/2/9.
 */

public class MyConvenientBarHolder implements Holder<show_5_itemBean> {
    ImageView imageView;
    ImageView icon;
    TextView textView;
    @Override
    public View createView(Context context) {
        View view = LayoutInflater.from(context).inflate(R.layout.item_show_0203,null);
        imageView = (ImageView) view.findViewById(R.id.imageView_show0201);
        icon = (ImageView) view.findViewById(R.id.icon_show0201);
        textView = (TextView) view.findViewById(R.id.textView_show0201);
        return view;
    }

    @Override
    public void UpdateUI(Context context, int position, show_5_itemBean data) {
        Glide.with(context).load(data.level1).placeholder(R.drawable.app_empty_icon).
                error(R.drawable.app_empty_icon).into(imageView);
        Glide.with(context).load(data.icon_level1).placeholder(R.drawable.app_empty_icon).
                error(R.drawable.app_empty_icon).into(icon);
        textView.setText(data.name);
        Log.e(TAG, "UpdateUI: "+data.name );
    }
}
